<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%@ page import="com.pptree.vo.*" %>
<%@ page import="com.pptree.service.*" %>
<%@ page import="com.pptree.service.impl.*" %>

<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%>

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<base href="<%=basePath%>">

<title>发布文章</title>

<meta http-equiv="pragma" content="no-cache">
<meta http-equiv="cache-control" content="no-cache">
<meta http-equiv="expires" content="0">
<meta http-equiv="keywords" content="keyword1,keyword2,keyword3">
<meta http-equiv="description" content="This is my page">

<link rel="stylesheet" href="${pageContext.request.contextPath}/ueditor/themes/default/css/ueditor.min.css" type="text/css"/>

<script type="text/javascript" charset="utf-8" src="${pageContext.request.contextPath}/ueditor/ueditor.config.js"></script>
<script type="text/javascript" charset="utf-8" src="${pageContext.request.contextPath}/ueditor/ueditor.all.js"></script>

<script type="text/javascript" charset="utf-8" src="${pageContext.request.contextPath}/ueditor/lang/zh-cn/zh-cn.js"></script>
<style type="text/css">
fieldset {
	border: 1px solid #1E82D1;
}

fieldset div {
    margin-bottom: 10px;
}

.btn {
	height: 30px;
	line-height: 30px;
	width: 80px;
	display: inline-block;
	background: #1E82D1;
	color: #fff;
	text-align: center;
	text-decoration: none;
	border-radius: 15px;
	border: none;
	cursor: pointer;
}

.red {
	font-size: 12px;
	color: #f00;
	font-weight: 700;
}
</style>

</head>

<body>
	<form id="topic-form" action="admin/addNewsHandle.jsp" method="post" enctype="multipart/form-data">
		<fieldset>
			<legend>新闻基本信息</legend>
			<div>
				<label for="tid">主题：</label> 
				<select id="tid" name="tid">
					<option value="0">请选择</option>
					<%
						GenreService genreService = new GenreServiceImpl();
						List<Genre> genreList = genreService.getAllCategories();
						for(Genre g : genreList) {
					%> 
						<option value="<%= g.getId() %>"><%= g.getName() %></option>
					
					<% } %>
				</select>
			</div>

			<div>
				<label for="title">标题：</label> <input type="text" name="title"
					id="title" />
			</div>

			<div>
				<label for="author">作者：</label> <input type="text" name="author"
					id="author" />
			</div>

			<div>
				<label for="summary">摘要：</label>
				<textarea rows="10" cols="100" name="summary" id="summary"></textarea>
			</div>

			<div>
				<label for="picpath">上传图片：</label> <input type="file" name="file" id="file" />
			</div>


			<div>
				<label for="content">内容：</label>
				<textarea id="content" style="width:90%;height: 400px" name="content" id="content"></textarea>
			</div>
			<div>
				${ message }
			</div>
			<div>
				<input value="发布" type="submit" class="btn" />
			</div>
		</fieldset>
	</form>
	
	<script type="text/javascript">
		UE.getEditor('content');
	</script>
</body>
</html>
